/**
 * 
 */
package second_assignment;

import java.util.LinkedList;
import java.util.Vector;

import fourth_assignment.Request;
import second_assignment.Manager;

/**
 * a wrapper class for running and testing project functionality.
 * 
 * @author Peretz Oded, Castel Maayan, Farchy Ofir.
 */
public class MainApp_2nd {

    public static void main(String[] args) 
    {	
        //Vector<Movie> temp;
        Vector<Integer> moviesAmount = new Vector<Integer>(3);
        Vector<Double> probability = new Vector<Double>(3);
        Vector<Integer> popularityDistrib = new Vector<Integer>(3);
        
        moviesAmount.add(0, Consts_2nd.M_Library);
        moviesAmount.add(1, Consts_2nd.M_Recorded);
        moviesAmount.add(2, Consts_2nd.M_RecentlyBroadcast);

        probability.add(0, Consts_2nd.p1);
        probability.add(1, Consts_2nd.p2);
        probability.add(2, Consts_2nd.p3);

        popularityDistrib.add(0, Consts_2nd.a1);
        popularityDistrib.add(1, Consts_2nd.a2);
        popularityDistrib.add(2, Consts_2nd.a3);
        
        LinkedList<Request> requestList = new LinkedList<Request>();

        for (int i = 0; i < probability.size(); ++i) {
        	System.out.println("For M(" + (i + 1) + "):");
        	System.out.println("Ammount of movies: " + moviesAmount.get(i).toString() +
        			", Group probability: " + probability.get(i).toString() +
        			", With a (" + popularityDistrib.get(i).toString() + "," +
        			(100 - popularityDistrib.get(i)) + ") distribution.");
        }

        Manager mngr = new Manager(probability, moviesAmount, popularityDistrib);
        
        // Printing vector F
//        temp = mngr.getCopiesArray();
//        int sum = 0;
//        
//        System.out.println("System initialization finished, Printing vector F:");
//        for (int i = 0; i < temp.size(); ++i) {
//            System.out.print(temp.get(i).toString() + ", ");
//            if (0 == (i+1)%30) {
//                System.out.println("    :" + (i+1)/30);
//            }
//            sum += temp.get(i).copies;
//        }
//        System.out.println();
//        System.out.println("Overall copies allocated: " + sum);
        
        // RUN SIMULATION
        mngr.ClientsManagment(requestList);
    }
}
